//////////////////////////////////////////////////
// guiGLWidget.h
//
// Author: Tarik Belabbas et Adrien Hoffer
//////////////////////////////////////////////////

#ifndef GUIGLWIDGET_H_
#define GUIGLWIDGET_H_

#include <QGLWidget>
#include <QTime>

//------------------------------------------------------------------------------
class guiGLWidget: public QGLWidget
{
public:
	guiGLWidget	();
	~guiGLWidget	();

	// Virtual functions
	virtual QSize	minimumSizeHint	()	const;
	virtual QSize	sizeHint		()	const;

private:
	// OpenGL drawing functions
	virtual void	initializeGL	();
	virtual void	paintGL			();
	virtual void	resizeGL		( int _width, int _height );

	// Timer event
	virtual void	timerEvent		( QTimerEvent* _event );

	// Mouse events
	virtual	void	mousePressEvent	( QMouseEvent* _event );
	virtual	void	mouseMoveEvent	( QMouseEvent* _event );
	virtual void	wheelEvent		( QWheelEvent* _event );

	// Keyboard events
	virtual void	keyPressEvent	( QKeyEvent* _event );
	virtual void	keyReleaseEvent	( QKeyEvent* _event );

	// Focus events
    virtual void	focusInEvent	( QFocusEvent* _event );
    virtual void	focusOutEvent	( QFocusEvent* _event );

	// Members
	QPoint				m_lastPos;

	QTime				m_time;
	int					m_frames;
};

#endif /* GUIGLWIDGET_H_ */
